package com.manor.main.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.manor.main.R;
import com.manor.main.bean.VisitorRecordBean;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class VisitorRecordAdapter extends BaseQuickAdapter<VisitorRecordBean, BaseViewHolder> {
    public VisitorRecordAdapter(int layoutResId, @Nullable List<VisitorRecordBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, VisitorRecordBean item) {
        helper.setText(R.id.tv_name, item.getName())
                .setText(R.id.tv_gender, item.getAge())
                .setText(R.id.tv_date, item.getDate());
        Glide.with(getContext()).load(item.getHead()).into((ImageView) helper.getView(R.id.iv_head));

    }
}
